import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserModule } from './modules/user/user.module';
import { User } from './modules/user/entities/user.entity';
import { UploadModule } from './modules/upload/upload.module';
import { WechatModule } from './modules/wechat/wechat.module';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'rm-2zer8f14h091175w0xo.mysql.rds.aliyuncs.com',
      port: 3306,
      username: 'yuanyu',
      password: 'Yuanyu@2024',
      // host: 'localhost',
      // port: 3306,
      // username: 'chunleibei',
      // password: 'bNxDdXB6jKZcxpdX',
      database: 'chunleibei',
      entities: [User],
      synchronize: true,
    }),
    UserModule,
    UploadModule,
    WechatModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
